<?php
class Pageley_Controller_Basic implements Pageley_Controller {

    protected $views;
    private static $logger;

    public function __construct($views) {
        $this->views = $views;
    }

    private function getLogger() {
        $logger = self::$logger;
        if($logger === null) {
            $logFactory = Pageley_Log_Factory::getInstance();
            $logger = $logFactory->getLogger($this);
        }
        return $logger;
    }

    public function handleRequest($parameters) {
        return new Pageley_Controller_ModelAndView(
                new Pageley_Util_ArrayMap(),
                $this->getView(Pageley_Controller_Result::SUCCESS));
    }

    protected function getView($alias) {
        return $this->views->get($alias);
    }
}